<template>
  <div>
    <view-img :image='image' @transferData='transferData'/>
    <h2>生成图片</h2>
    <div>
      <img :src="src" alt="">
    </div>
  </div>
</template>

<script lang="ts">
import { Component, Vue } from 'vue-property-decorator'

interface params{
  url: string;
  file: any
}
@Component({
  name: 'rotateImg'
})
export default class extends Vue {
  private image = 'https://i.picsum.photos/id/52/346/216.jpg?hmac=n6EZ0PmQwUh-qhUXhQvA1rTKSn7UZdYvPbDXVIms1Fs'
  private src = ''

  // 从子组件过来的值
  transferData (obj: params) {
    this.src = obj.url
  }
}
</script>

<style lang="scss" scoped>
</style>
